/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.odhixon.volarme.gui;

import com.odhixon.volarme.VolarME;
import com.sun.lwuit.Component;
import com.sun.lwuit.Container;
import com.sun.lwuit.Label;
import com.sun.lwuit.List;
import com.sun.lwuit.layouts.BorderLayout;
import com.sun.lwuit.list.ListCellRenderer;
import com.sun.lwuit.plaf.Border;
import com.sun.lwuit.util.Resources;

/**
 * PointerRender.
 * @author Ariel Aguirre <odhixon@gmail.com>
 */
public class PointerRender extends Container implements ListCellRenderer {
    private Label labelTitle;
    private Label focus;

    public PointerRender() {
        try {
            Resources resources = VolarME.getResource();
            setLayout(new BorderLayout());
            labelTitle = new Label();
            labelTitle.getStyle().setBgTransparency(0);
            //labelTitle.getStyle().setFont(Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_SMALL));
            this.addComponent(BorderLayout.CENTER, labelTitle);

            focus = new Label();
            focus.setIcon(resources.getImage("pointer"));
            focus.setAlignment(Label.RIGHT);
            focus.setUIID("LABEL_FOCO");
            //focus.getStyle().setBorder(	Border.createRoundBorder(20, 20, false) );
            //focus.getStyle().setBgColor(16763174);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    public Component getListCellRendererComponent(List list, Object value, int index, boolean isSelected) {
        labelTitle.setText((String) value);
        return this;
    }

    public Component getListFocusComponent(List list) {
        return focus;
    }
}
